﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Abp.Domain.Services;
using AVISOutBound.SSOServer.Payment.Wechat;
using Microsoft.AspNetCore.Http;

namespace AVISOutBound.SSOServer.Payment
{
    public interface IWechatManager: IDomainService
    {

        /// <summary>
        /// 获取预支付交易ID的支付签名
        /// </summary>
        /// <param name="appid">应用ID</param>
        /// <param name="key">微信支付——商家支付密钥</param>
        /// <param name="prepayId">预支付ID。通过调用Pay()获取</param>
        /// <returns></returns>
        Task<WechatPaySign> GetPaySign(string appid, string key, string prepayId);

        /// <summary>
        /// PC网站支付
        /// </summary>
        /// <param name="param">微信支付参数</param>
        /// <returns></returns>
        Task<string> PcPay(WechatPayParam param);

        /// <summary>
        /// 手机网站支付
        /// </summary>
        /// <param name="param">微信支付参数</param>
        /// <returns></returns>
        Task<string> WapPay(WechatPayParam param);

        /// <summary>
        /// 公众号支付
        /// </summary>
        /// <param name="param">微信支付参数</param>
        /// <returns></returns>
        Task<WechatPayResult> PublicPay(WechatPayParam param);

        /// <summary>
        /// 处理微信支付回调内容
        /// </summary>
        /// <param name="context">Http上下文</param>
        /// <returns></returns>
        WechatPayReceive ParseNotify(HttpContext context);

        /// <summary>
        /// 支付退款
        /// </summary>
        /// <param name="param">微信退款参数</param>
        /// <returns></returns>
        WechatRefundResult Refund(WechatRefundParam param);
    }
}
